<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>系统用户_编辑</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="<?php echo STATIC_ADMIN; ?>bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="//cdn.bootcss.com/ionicons/2.0.1/css/ionicons.min.css">

    <link rel="stylesheet" href="<?php echo STATIC_ADMIN; ?>dist/css/AdminLTE.css">
    <link rel="stylesheet" href="<?php echo STATIC_ADMIN; ?>dist/css/skins/_all-skins.css">

    <link rel="stylesheet" href="<?php echo STATIC_ADMIN; ?>dist/css/yc_style.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="//cdn.bootcss.com/html5shiv/3.7.3/html5shiv.js"></script>
  <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
  <![endif]-->
</head>
<body class="hold-transition skin-blue">
<!-- Site wrapper -->
<div class="wrapper">

  <!-- main -->
  <div class="content-wrapper" style="margin: 0;">

      <!-- page title -->
    <section class="content-header">
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-gear"></i> 系统管理</a></li>
        <li><a href="#">系统用户</a></li>
        <li class="active">编辑</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="alert alert-dismissible" role="alert" style="display: none;">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <strong>提示：</strong><span id="msg">消息</span>
        </div>

      <!-- Default box -->
      <div class="box box-info">
          <div class="box-header with-border">
              <h3 class="box-title">编辑用户</h3>
          </div>

          <form class="form-horizontal" id="acl_add" name="acl_add" method="post" action="<?php echo site_url('system/User/save');?>">
              <input type="hidden" id="user_id" name="user_id" value="<?php echo $user['user_id'];?>">
              <div class="box-body">
                  <div class="form-group">
                      <label for="user_role" class="col-sm-1 control-label">所属角色</label>
                      <div class="col-sm-4">
                          <select class="form-control" id="user_role" name="user_role"
                                  datatype="*"
                                  nullmsg="请选择所属角色"
                                  errormsg="请选择所属角色">
                              <option value="">≡ 请选择 ≡</option>
                              <?php
                              foreach ($role as $val) {
                                  ?>
                                  <option value="<?php echo $val['role_id'];?>" <?php echo $user['user_role']==$val['role_id']?'selected':'';?>><?php echo $val['role_name'];?></option>
                              <?php }?>
                          </select>
                      </div>
                  </div>

                  <div class="form-group">
                      <label for="user_name" class="col-sm-1 control-label">用户名称</label>
                      <div class="col-sm-4">
                          <input class="form-control" id="user_name" name="user_name" type="text" value="<?php echo $user['user_name'];?>" disabled>
                      </div>
                  </div>

                  <div class="form-group">
                      <label for="user_pass" class="col-sm-1 control-label">登录密码</label>
                      <div class="col-sm-4">
                          <input class="form-control" id="user_pass" name="user_pass" type="password"
                                 datatype="yes_null|scope_string_2,*6-20"
                                 nullmsg="登录密码不能为空"
                                 errormsg="登录密码必须包含英文字母与数字，长度在6~20位之间"
                                 placeholder="登录密码">
                          <div class="Validform_checktip">不修改请留空。登录密码必须包含英文字母与数字，长度在6~20位之间</div>
                      </div>
                  </div>

                  <div class="form-group">
                      <label for="user_pass_confirm" class="col-sm-1 control-label">确认密码</label>
                      <div class="col-sm-4">
                          <input class="form-control" id="user_pass_confirm" name="user_pass_confirm" type="password"
                                 datatype="yes_null|scope_string_2,*6-20"
                                 recheck="user_pass"
                                 nullmsg="请再次输入登录密码"
                                 errormsg="两次输入密码不一致"
                                 placeholder="确认密码">
                          <div class="Validform_checktip"></div>
                      </div>
                  </div>

                  <div class="form-group">
                      <label for="user_realname" class="col-sm-1 control-label">真实姓名</label>
                      <div class="col-sm-4">
                          <input type="text" class="form-control" id="user_realname" name="user_realname"
                                 datatype="yes_null|check_name"
                                 nullmsg="请填写真实姓名"
                                 errormsg="姓名格式不正确。中文字符之间不允许有空格，英文字符之间只能有一个空格"
                                 placeholder="真实姓名"
                                 value="<?php echo $user['user_realname'];?>">
                          <div class="Validform_checktip"></div>
                      </div>
                  </div>


                  <div class="form-group">
                      <label for="user_email" class="col-sm-1 control-label">邮箱</label>
                      <div class="col-sm-4">
                          <input class="form-control" id="user_email" name="user_email" type="text"
                                 datatype="yes_null|e"
                                 nullmsg="请填邮箱"
                                 errormsg="邮箱格式不正确"
                                 placeholder="用户邮箱"
                                 value="<?php echo $user['user_email'];?>">
                          <div class="Validform_checktip"></div>
                      </div>
                  </div>

                  <div class="form-group">
                      <label for="user_mobile" class="col-sm-1 control-label">手机号码</label>
                      <div class="col-sm-4">
                          <input type="text" class="form-control" id="user_mobile" name="user_mobile"
                                 datatype="yes_null|check_mobile"
                                 nullmsg="请填手机号码"
                                 errormsg="手机号码格式不正确"
                                 placeholder="手机号码"
                                 value="<?php echo $user['user_mobile'];?>">
                          <div class="Validform_checktip"></div>
                      </div>
                  </div>

                  <div class="form-group">
                      <label for="user_status" class="col-sm-1 control-label">状态</label>
                      <div class="col-sm-1">
                          <select class="form-control" id="user_status" name="user_status">
                              <option value="1">正常</option>
                              <option value="0">锁定</option>
                          </select>
                      </div>
                  </div>
              </div>

              <div class="box-footer">
                  <a href="<?php echo site_url('system/User/index');?>" class="btn btn-default" role="button">取消</a>
                  <button type="submit" class="btn btn-info pull-right">保存</button>
              </div>
          </form>
      </div>
      <!-- /.box -->

    </section>
    <!-- /.content -->
  </div>
  <!-- main end -->
</div>
<!-- ./wrapper -->

</body>
</html>
<!-- jQuery 2.2.3 -->
<script src="<?php echo STATIC_COMMON; ?>plugins/jQuery/jquery-2.2.3.min.js"></script>
<!-- Bootstrap 3.3.6 -->
<script src="<?php echo STATIC_ADMIN; ?>bootstrap/js/bootstrap.min.js"></script>
<!-- layer 3.0.3 -->
<script src="<?php echo STATIC_COMMON; ?>plugins/layer/layer.js"></script>

<!-- Validform 5.3.2 -->
<script src="<?php echo STATIC_COMMON; ?>plugins/Validform/Validform_v5.3.2.js"></script>

<!-- other -->
<script src="<?php echo STATIC_ADMIN; ?>dist/js/yc_app.js"></script>

<script>
    $(function() {
        ycApp.initValidator();
    });
</script>
